Method for determining a direction of a spin axis of a rotating apparatus

ABSTRACT

A method for determining a direction of a spin axis of a rotating apparatus which includes an XYZ-magnetic field sensor. The method includes determining a global direction of a magnetic field; rotating the rotating apparatus around the spin axis, measuring at least one magnetic field value as a function of time with the XYZ-magnetic field sensor when the rotating apparatus is rotating about the spin axis, computing a magnetic field component of the magnetic field in a direction of a local body co-ordinate of the spin axis of the rotating apparatus from the measured at least one magnetic field value and determining a direction of the spin axis using the computed magnetic field component of the magnetic field and the determined global direction of the magnetic field.

TECHNICAL FIELD

The aspects of the disclosed embodiment generally relate to a system and method for determining a direction of a spin axis of a rotating apparatus. Moreover, the aforesaid system, when in operation, determines a location of the rotating apparatus relative to a specified target by combining the direction of the spin axis of the rotating apparatus with a horizontal displacement of the rotating apparatus.

BACKGROUND

It is important to track the movement of one or more projectiles, also referred to herein as a rotating apparatus, such as for example one or more balls, utilized when playing a sports game, for example football or basketball, to determine statistical information relating to the sports game. Such statistical information can include the number of goals or points scored, shots taken, passes made, as well as a performance of one or more players of the sports game. Such tracking has often been implemented using cameras, personnel collating statistics manually as well as using sensors included in the one or more projectiles. However, known approaches for analyzing movement of the one or more projectiles are not well developed, such that adequate analysis of sports games utilizing the one or more projectiles is not presently achievable.

One of the problems in tracking the movement of a projectile is the difficulty in determining a direction at or in which a projectile is heading along its trajectory. The direction of the projectile is essential in order to analyze, for example, how a basketball was shot. The direction measurement can be done in theory, for example with use of a location beacon setup (i.e. triangulation or trilateration). Problem with such setup is that it requires beacons and is thus expensive and complex. In addition to the direction a location of a projectiles is of interest in many applications. For example when analyzing a game location information of a projectile before and after a shot or kick is needed to know. The location of the projectile has been measured using beacon based location systems. Such systems are expensive and complex.

Furthermore, the direction measurement could be done with use of an electronic-compass. However the e-compass cannot be used to determine the direction of a trajectory as it only indicates the direction of the magnetic field in respect to the compass. There is no information on which way the projectile having the e-compass is moving. As an example, the e-compass might indicate that the left side of the projectile is facing north but the projectile itself is moving east. Due to the arbitrary orientation of the projectile with respect to the trajectory, the e-compass is not capable to track properties of the trajectory in which we are interested.

Additional problem related to measuring properties of projectile which has been thrown/ejected to the ballistic trajectory is to determine how fast the projectile is spinning (i.e. a spin rate) and also what is the tilt angle between the spin axis and the ground. The spin rate is an important parameter to analyze how the projectile is handled. For example, when making a shot with a basketball, an ideal spin rate is about three revolutions per second. In another example, when trying to kick a soccer ball in a curved way, a non-zero spin rate is required to make the shot curve.

The spin axis measurement is important, for example, in case of basketball. If the spin axis is not parallel to a playing field, then the basketball may bounce in unfavorable manner when the basketball hits a rim. Also, a horizontal spin axis assures that the Magnus effect increases the ball entry angle, therefore making the basket to appear larger.

Further, existing systems that track the movement, location or spin rate of the projectile consume more power, as they have multiple sensors and those multiple sensors are on all the time. Some of the systems, as discussed require also external beacons.

Therefore, considering the foregoing discussion, there exists a need to address the aforementioned drawbacks in determining a direction in which the projectile is heading. In particular, the problem addressed by the aspects of the disclosed embodiments is related to determining a direction of a spin axis of a spherical object, projectile or ball. Furthermore the present disclosure provides improved method for determining a location of a projectile.

Embodiments of the present disclosure substantially eliminate or at least partially address the aforementioned drawbacks in determining the direction of the spin axis of the rotating apparatus.

SUMMARY

According to a first aspect, the aspects of the disclosed embodiments are directed to determining a direction of a spin axis of an apparatus that is configured to rotate. The rotating apparatus comprises a XYZ-magnetic field sensor. In one embodiment, the method comprises:

-   -   determining a global direction of a magnetic field;     -   providing a rotation for the rotating apparatus around the spin         axis, wherein the spin axis comprises a line including points in         a three-dimensional space which remain fixed during the rotation         of the rotating apparatus;     -   measuring a plurality of magnetic field values as a function of         time with the XYZ-magnetic field sensor when the rotating         apparatus is rotating around the spin axis;     -   computing a magnetic field component of the magnetic field in a         direction of a local body co-ordinate of the spin axis of the         rotating apparatus from the measured plurality of magnetic field         values; and     -   determining a direction of the spin axis using the computed         magnetic field component of the magnetic field and the         determined global direction of the magnetic field.

Optionally, in the method, the determining of the direction of spin axis further comprises

-   -   determining an angle between the spin axis and a horizontal         ground plane; and     -   using the determined angle to refine the determined direction of         the spin axis.

Optionally, in the method, the spin axis is determined by

-   -   finding a direction that minimizes a variance of the measured         plurality of magnetic field values; and     -   resolving a sign ambiguity related to the found minimum variance         solution by comparing two consequently measured magnetic field         values of the measured plurality of magnetic field values with         each other.

Optionally, the method comprises

-   -   estimating a horizontal displacement of the rotating apparatus         using at least one of a flight time, a release speed, an initial         height, and a height of the rotating apparatus in respect to         ground; and     -   determining a location of the rotating apparatus relative to a         specified target by combining the direction of the spin axis of         the rotating apparatus with the horizontal displacement.

Optionally, in the method, the global direction of the magnetic field is determined by

-   -   ejecting the rotating apparatus for at least one time in a         trajectory to known horizontal direction,     -   using at least one of local environment related geographical         information, or     -   using a second sensor.

Optionally, the method comprises using an accelerometer of the rotating apparatus for

-   -   detecting if the rotating apparatus is ejected on a ballistic         trajectory, and     -   activating the XYZ-magnetic field sensor if the rotating         apparatus is detected to be in the ballistic trajectory.

Optionally, in the method, the direction of the spin axis is determined during the time interval when the rotating apparatus is on a ballistic trajectory.

According to a second aspect, the present disclosure provides a rotating apparatus, comprising:

-   -   a body;     -   a XYZ-magnetic field sensor arranged inside of the body and         configured to measure at least one magnetic field value as a         function of time when the rotating apparatus is rotating around         a spin axis;     -   a control module arranged inside of the body and communicatively         connected to the XYZ-magnetic field sensor, wherein the control         module is configured to         -   receive the measured at least one magnetic field value;         -   compute a magnetic field component of the at least one             measured magnetic field value in a direction of a local body             co-ordinate of the spin axis of the rotating apparatus from             the received at least one measured magnetic field value; and     -   determine a direction of the spin axis using the computed         magnetic field component of the at least one measured magnetic         field value and the determined global direction of the at least         one measured magnetic field value.

Optionally, the rotating apparatus comprises a gyroscope.

Optionally, the rotating apparatus comprises an accelerometer, the accelerometer being configured to provide accelerometer measurements to the control module and the control module is configured to:

-   -   detect from the provided measurements if the rotating apparatus         is ejected on a ballistic trajectory, and     -   provide an activation signal to the XYZ-magnetic field sensor if         the rotating apparatus is detected to be in the ballistic         trajectory to activate magnetic field measurement.

According to a third aspect, the present disclosure provides a system for determining a location of a rotating apparatus, wherein the rotating apparatus is configured to:

-   -   determine a direction of a spin axis of the rotating apparatus;     -   estimate a horizontal displacement of the rotating apparatus         from a place of ejecting the rotating apparatus towards a         specified target; and     -   provide the determined direction of the spin axis and the         estimated horizontal displacement to a portable computing         device,         wherein the portable computing device is configured to use the         provided direction and displacement values to determine a         location of the rotating apparatus in respect to the specified         target. The location of the apparatus can be used to render for         a user analysis of a game or practice done with the rotating         apparatus as an example.

According to a fourth aspect, the disclosed embodiments are directed to a method for determining a direction of a spin axis of a rotating apparatus, the rotating apparatus comprising a XYZ-magnetic field sensor and a gyroscope, the method comprising:

-   -   determining a global direction of a magnetic field;     -   providing a rotation for the rotating apparatus about the spin         axis, wherein the spin axis is defined along a line including         points in a three-dimensional space which remain fixed during         the rotation of the rotating apparatus;     -   measuring at least one magnetic field value with the         XYZ-magnetic field sensor when the rotating apparatus is         rotating about the spin axis;     -   measuring at least one angular speed value and orientation value         with the gyroscope     -   determining a direction of the spin axis using measured at least         one magnetic field value, the at least one angular speed value,         the orientation value and the determined global direction of the         magnetic field.

Additional aspects, advantages, features and objects of the aspects of the disclosed embodiments are made apparent from the drawings and the detailed description of the illustrative embodiments construed in conjunction with the appended claims that follow.

It will be appreciated that features of the aspects of the disclosed embodiments are susceptible to being combined in various combinations without departing from the scope of the disclosed embodiments as defined by the appended claims.

BRIEF DESCRIPTION OF THE DRAWINGS

The summary above, as well as the following detailed description of illustrative embodiments, is better understood when read in conjunction with the appended drawings. For the purpose of illustrating the present disclosure, exemplary constructions of the disclosure are shown in the drawings. However, the present disclosure is not limited to specific methods and instrumentalities disclosed herein. Moreover, those in the art will understand that the drawings are not to scale. Wherever possible, like elements have been indicated by identical numbers.

Embodiments of the present disclosure will now be described, by way of example only, with reference to the following diagrams wherein:

FIG. 1 is a schematic illustration of a rotating apparatus in accordance with an embodiment of the present disclosure;

FIG. 2 is a schematic illustration of a system in accordance with an embodiment of the present disclosure;

FIG. 3 is a schematic illustration of a rotating apparatus in accordance with an embodiment of the present disclosure;

FIG. 4 is a schematic illustration of a game field in accordance with an embodiment of the present disclosure;

FIG. 5 is a graphical illustration of accelerations of a shot measured by an accelerometer attached with a rotating apparatus in accordance with an embodiment of the present disclosure;

FIG. 6 is a graphical illustration of values of magnetic field components in accordance with an embodiment of the present disclosure; and

FIGS. 7A-7B are flowcharts illustrating an exemplary process flow for a method for determining a direction of a spin axis of a rotating apparatus in accordance with an embodiment of the present disclosure.

In the accompanying drawings, an underlined number is employed to represent an item over which the underlined number is positioned or an item to which the underlined number is adjacent. A non-underlined number relates to an item identified by a line linking the non-underlined number to the item. When a number is non-underlined and accompanied by an associated arrow, the non-underlined number is used to identify a general item at which the arrow is pointing.

DETAILED DESCRIPTION OF EMBODIMENTS

The following detailed description illustrates embodiments of the present disclosure and ways in which they can be implemented. Although some modes of carrying out the present disclosure have been disclosed, those skilled in the art would recognize that other embodiments for carrying out or practicing the present disclosure are also possible.

The present disclosure provides a method for determining a direction of a spin axis of a rotating apparatus, the rotating apparatus comprising a XYZ-magnetic field sensor, the method comprising:

-   -   determining a global direction of a magnetic field;     -   providing a rotation for the rotating apparatus around the spin         axis, wherein the spin axis comprises a line including points in         a three-dimensional space which remain fixed during the rotation         of the rotating apparatus;     -   measuring a plurality of magnetic field values as a function of         time with the XYZ-magnetic field sensor when the rotating         apparatus is rotating around the spin axis;     -   computing a magnetic field component of the magnetic field in a         direction of a local body co-ordinate of the spin axis of the         rotating apparatus from the measured plurality of magnetic field         values; and     -   determining a direction of the spin axis using the computed         magnetic field component of the magnetic field and the         determined global direction of the magnetic field.

The present method thus determines the direction of the spin axis of the rotating apparatus. The rotating apparatus can be for example an object or projectile such as a basketball, a football, a volleyball, a baseball, bowling, lacrosse ball, a handball, soccer ball, tennis ball, ice hockey puck, javelin etc. In general the rotating apparatus term refers to an object which, when in use, has a rotating movement or has tendency to have a rotating movement.

According to the present disclosure the rotating apparatus is provided with a rotation around the spin axis. As an example when a basketball is thrown it typically rotates due to a spin caused by a hand of the player (i.e. basketball is then a rotating apparatus). In a method a rotation is provided for the rotating apparatus about the spin axis. The spin axis is defined along a line including points in a three-dimensional space which remain fixed during the rotation of the rotating apparatus. In essence the term “spin axis” thus refers to a geometrical line about which the rotating apparatus is rotating. The spin axis remains fixed in a local frame of reference in comparison to the rotating apparatus.

An additional example of rotating apparatus is a javelin. As the javelin is thrown it tends to rotate along its longest axis. A further example of a rotating apparatus is a hockey puck. As the puck is shot or passed, there will be a tendency for the puck to lift off the ice and “fly” in the air. It is not uncommon for the moving puck to also rotate as well. Furthermore the rotation can also take place for a hockey puck also when it is sliding in top of ice.

As one more example of a rotating apparatus is a football. As the football is provided with rotation it might roll on a football field (during rolling it rotates).

A global direction of the magnetic field is determined. The global direction refers to for example a direction towards magnetic North pole. This direction can be determined using for example an external apparatus such as e-compass of a smart phone or it can be determined for each location where the rotating apparatus is used. As an example a global direction of the magnetic field in respect to a basketball court might be defined with a map.

In one embodiment, the rotating apparatus includes one or more magnetic field sensors. In an embodiment, the one or more magnetic field sensors are attached or arranged inside (i.e. an inner surface) the rotating apparatus. The one or more magnetic field sensors are configured to measure magnetic field values in X, Y and Z directions. In an embodiment, the one or more magnetic field sensors, without limitation, may be selected from triaxial magnetometers. In an embodiment, the magnetic field sensor comprises three separate sensor elements arranged orthogonally in respect to each other to form the XYZ-magnetic field sensor. In an embodiment, each magnetic field sensor is configured to measure a value of the magnetic field as a function of time, for example, each magnetic field sensor optionally provides a value related to the magnetic field strength for every 0.1 seconds. The magnetic field sensor optionally provides a value related to the magnetic field strength for every 1 seconds or 10 seconds. In an embodiment, each magnetic field sensor is individually calibrated to remove most significant error sources.

The XYZ-magnetic field sensor of the rotating apparatus measures a plurality of magnetic field values as a function of time when the rotating apparatus is rotating about the spin axis. The measured plurality of magnetic field values are used to compute a magnetic field component of the magnetic field in a direction of a local body co-orinate of the spin axis of the rotating apparatus.

A direction of the spin axis is determined using the computed magnetic field components of the magnetic field and the determined global direction of the magnetic field.

According to an embodiment computing and determining are performed with a control module. Furthermore measurement and/or collecting measurement results from the XYZ-magnetic field sensor can be performed with the control unit. The control module might be a computing unit arranged inside of the rotating apparatus. Alternatively, the control module can be external to the rotating apparatus (and communicate wirelessly), without limitation, and the control module may be selected from a mobile phone, a smart telephone, a Mobile Internet Device (MID), a tablet computer, an Ultra-Mobile Personal Computer (UMPC), a phablet computer, a Personal Digital Assistant (PDA), a web pad, a handheld Personal Computer (PC), and a laptop computer. The control module optionally communicates with a server through a network. In an embodiment, the network is a wired network, a wireless network, or a combination of a wired network and a wireless network. In an embodiment, the network is the Internet. In further example part of the functionality of the control module can be arranged inside of the rotating apparatus (as form of microcontroller) and part outside (as form of smart phone connected via wireless connection, such as Bluetooth, to the microcontroller).

The control module determines the direction of the spin axis using the computed magnetic field component of the magnetic field and the determined global direction of the magnetic field. The determined direction of the spin axis can be used to analyze which direction (i.e. heading) the rotating apparatus is moving in along its trajectory. As an example the direction of the spin axis can be used to determine that a ball is heading (during a shot) towards East or for example, at an angle of 45 degrees in respect to a basketball court or other playing field.

In one example embodiment, in the game of basketball, the ball is the rotating apparatus and such a quantity may be an angle between the spin axis of the ball and a horizontal plane, where a nonzero angle indicates a problem in a shooting technique of a player. In another example embodiment, in the game of football where the football is the rotating apparatus, the spin axis of the football is exploited to determine a change in a direction of the trajectory of the football and the direction of the spin axis of the football in the surrounding, which are key parameters in computing an overall shape of a realized trajectory of the football.

In an embodiment, the global magnetic field is the earth's magnetic field surrounding the rotating apparatus which is homogenic. The magnetic field will be essentially constant if the rotating apparatus is located in at least one of (i) an indoor environment or (ii) an outdoor environment.

In an embodiment, the magnitude of the magnetic field is arbitrary, and the magnetic field for any single basket is characterized by parameters such magAz (which is a horizontal direction of surrounding magnetic field with respect to an x-axis of a selected global reference frame), and magEle (which is a vertical direction of the magnetic field or an inclination angle of the magnetic field with respect to a local horizontal plane). The normalized magnetic field i.e. with unit magnitude for any single basket is expressed in a form as follows:

$B = \begin{bmatrix} {{\cos ({magEle})}\mspace{14mu} {\cos ({magAz})}} \\ {{\cos ({magEle})}\mspace{14mu} {\sin ({magAz})}} \\ {- {\sin ({magEle})}} \end{bmatrix}$

As an example, in the game of basketball using a right-handed coordinate system, x points towards the basket along the sidelines of a court; y points to right and is orthogonal to the sidelines and z points vertically down. In an embodiment, the global reference frame specified in this way is called a court frame.

In an embodiment, the goal structures, such as the baskets, which are typically metal. Occasionally the ground plane may introduce local disturbances to the magnetic field, but the homogeneity assumption is typically valid whenever the basketball is thrown or otherwise flying in the air.

The spin axis represented in the local reference frame is constant during any period of time including unobstructed and unforced movement of the rotating apparatus such as a flight of the rotating apparatus in air or a slide of a puck on ice. In an embodiment, a constant spin axis in the local reference frame does imply the constant spin axis in the global reference frame. Even though, the spin axis is constant, an angular velocity about that spin axis need not be constant.

In an example embodiment the spin axis is determined by finding a direction that minimizes a variance of the measured plurality of magnetic field values. This found direction that minimizes a variance of the measured plurality of magnetic field values (minimum variance solution) might have two possible solutions (negative and positive i.e. there is a sign ambiguity related to the solution). The solution is further analyzed to resolve a sign ambiguity related to the found minimum variance solution by comparing two consecutively measured magnetic field values of the measured plurality of magnetic field values with each other.

In an embodiment, the found axis is used to transform a basis transformation into a basis where one of the axes is aligned with the spin axis. The found direction that minimized a variance of the measured plurality of magnetic field values and the resolved sign is used as a direction of the spin axis.

Denoting a real-valued N×3 matrix that includes the measured plurality of magnetic field values during a time period of interest by M. The spin axis is determined by employing a new orthogonal and right-handed basis for the measured plurality of magnetic field values, such that the variance of the measured plurality of magnetic field values in a direction of at least one basis vector is minimized. In an embodiment, the basis vector with the minimal variance including only noise and some variations of the magnetic field is determined as the spin axis. The spin axis represented in the local reference frame is determined as a solution of an optimization problem:

±s _(a)=

var(Mw) such that w ^(T) w=1,

which accounts for determining a linear combination of the three orthogonal axes minimizing the variance of the measured plurality of magnetic field values in a direction of unit vector (w). In an embodiment, the sign ambiguity follows as the variance is always positive. The optimization problem presented above is equivalently presented as:

${{\pm \begin{bmatrix} \alpha_{sa} \\ \beta_{sa} \end{bmatrix}} = {{argmin}_{\alpha,{\beta \in {\mathbb{R}}}}\mspace{14mu} {var}\mspace{14mu} \left( {M\begin{bmatrix} {\cos \mspace{14mu} \alpha \mspace{14mu} \cos \mspace{14mu} \beta} \\ {\cos \mspace{14mu} \alpha \mspace{14mu} \sin \mspace{14mu} \beta} \\ {\sin \mspace{14mu} \alpha} \end{bmatrix}} \right)}},$

where the unit constraint is a feature of a selected parameterization. In an embodiment, the minimization problem above is presented as a variance maximization problem with the aim to determine an axis orthogonal to the spin axis.

The optimization problem is solved up to the sign ambiguity with any optimization routine starting from an arbitrary initial guess which leads to one of the two optima. Additionally, a specific initial guess for an optimization algorithm is obtained by resolving a singular value decomposition using an equation as follows:

UΣV ^(T) =svd(M),

and choosing a right singular vector v_(i) (a column of V) with smallest var (Mv_(i)). This is equivalent to resolving V as eigenvectors of a normal matrix M^(T)M. In an embodiment, the selected v_(i) may yield an estimate of the spin axis on its own, but typically the most accurate estimates of the spin axis are obtained as a solution of a presented variance minimization problem.

In an embodiment, determining the spin axis of the rotating apparatus results in two potential solutions for the spin axis corresponding to alternative shot directions due to the sign ambiguity. The sign ambiguity is solved by analysis of the gathered data (i.e. the plurality of magnetic fields). In an embodiment, the observed magnetic fields are measured at known time intervals and/or at a constant sample rate and are stored in a temporal order.

In an embodiment, the computed magnetic field component of the magnetic field is not a constant. For example, nutation and precession may cause the computed magnetic field component to change as a function of time and the change information is used to obtain further information about trajectory of the rotating apparatus.

In an embodiment, the control module constructs a dynamic model that represents the rotation of the rotating apparatus. The dynamic model determines a spin rate consistent with the dynamic model and time-dependent data using Rodrigues' rotation formula as follows:

C(s _(a),θ)=I ₃ cos θ+(1−cos θ)s _(a) s _(a) ^(T)+[s _(a)]_(x) sin θ

where θ represents a net rotation angle over the spin axis, and [s_(a)]_(x) is the skew-symmetric form of s_(a). With a further assumption of a constant spin rate, θ=ωt.

The Rodrigues' rotation formula expands to form

${{C\left( {\omega \; t} \right)} = \begin{bmatrix} {{\left( {1 - {\cos \left( {\omega \; t} \right)}} \right)s_{a,x}^{2}} + {\cos \left( {\omega \; t} \right)}} & {{\left( {1 - {\cos \left( {\omega \; t} \right)}} \right)s_{a,x}s_{a,y}} - {s_{a,z}\mspace{14mu} {\sin \left( {\omega \; t} \right)}}} & {{\left( {1 - {\cos \left( {\omega \; t} \right)}} \right)s_{a,x}s_{a,z}} + {s_{a,y}\mspace{14mu} {\sin \left( {\omega \; t} \right)}}} \\ {{\left( {1 - {\cos \left( {\omega \; t} \right)}} \right)s_{a,y}s_{a,x}} + {s_{a,z}\mspace{14mu} {\sin \left( {\omega \; t} \right)}}} & {{\left( {1 - {\cos \left( {\omega \; t} \right)}} \right)s_{a,y}^{2}} + {\cos \left( {\omega \; t} \right)}} & {{\left( {1 - {\cos \left( {\omega \; t} \right)}} \right)s_{a,y}s_{a,z}} - {s_{a,x}\mspace{14mu} {\sin \left( {\omega \; t} \right)}}} \\ {{\left( {1 - {\cos \left( {\omega \; t} \right)}} \right)s_{a,z}s_{a,x}} - {s_{a,y}\mspace{14mu} {\sin \left( {\omega \; t} \right)}}} & {{\left( {1 - {\cos \left( {\omega \; t} \right)}} \right)s_{a,z}s_{a,y}} + {s_{a,x}\mspace{14mu} {\sin \left( {\omega \; t} \right)}}} & {{\left( {1 - {\cos \left( {\omega \; t} \right)}} \right)s_{a,z}^{2}} + {\cos \left( {\omega \; t} \right)}} \end{bmatrix}},$

which is used to couple any pair of sample triplets m_(i), m_(j) as follows:

m _(j) =C(w(t _(j) −t _(i)))m _(i)

From this, after algebraic manipulation, three equations of the general form are obtained for each pair of sample triplets with values as follows:

a  cos (ω t) + b  sin (ω t) + c = 0 $a = \left\{ {{\begin{matrix} {{\left( {1 - s_{a,x}^{2}} \right)m_{i,x}} - {s_{a,x}s_{a,y}m_{i,y}} - {s_{a,x}s_{a,z}m_{i,z}}} \\ {{\left( {1 - s_{a,y}^{2}} \right)m_{i,y}} - {s_{a,y}s_{a,x}m_{i,x}} - {s_{a,y}s_{a,z}m_{i,z}}} \\ {{\left( {1 - s_{a,z}^{2}} \right)m_{i,z}} - {s_{a,z}s_{a,x}m_{i,x}} - {s_{a,z}s_{a,y}m_{i,y}}} \end{matrix}b} = \left\{ {{\begin{matrix} {{s_{a,y}m_{i,z}} - {s_{a,z}m_{i,y}}} \\ {{s_{a,z}m_{i,x}} - {s_{a,x}m_{i,z}}} \\ {{s_{a,x}m_{i,y}} - {s_{a,y}m_{i,x}}} \end{matrix}c} = \left\{ \begin{matrix} {{s_{a,x}^{2}m_{i,x}} + {s_{a,x}s_{a,y}m_{i,y}} + {s_{a,x}s_{a,z}m_{i,z}} - m_{j,x}} \\ {{s_{a,y}^{2}m_{i,y}} + {s_{a,y}s_{a,x}m_{i,x}} + {s_{a,y}s_{a,z}m_{i,z}} - m_{j,y}} \\ {{s_{a,z}^{2}m_{i,z}} + {s_{a,z}s_{a,x}m_{i,x}} + {s_{a,z}s_{a,y}m_{i,y}} - m_{j,z}} \end{matrix} \right.} \right.} \right.$

The multiples of π, are neglected and this kind of equation may include up to two unique results:

$\omega = {\frac{2}{t_{j} - t_{i}}\tan^{- 1}\frac{b \pm \sqrt{a^{2} + b^{2} - c^{2}}}{a - c}}$

However, only one result of which provides consistent values for co over different axes and sample triplets m_(i), m_(j). In an embodiment, a pair of observed magnetic field may lead to a negative discriminant (a²+b²−c²) and therefore lead to imaginary results.

In an embodiment, if an average of a consistent spin rate estimate is positive, the direction of the spin axis obtained above is correct. In another embodiment, if the average of the consistent spin rate is negative, the direction of the obtained spin axis may be reversed.

The control module optionally estimates components of the surrounding homogenic magnetic field in the direction of the spin axis s_(a) by its average value when the rotating apparatus rotates about a constant axis in the homogenic magnetic field. The average value is calculated using an equation as follows:

$b_{sa} = {\frac{1}{N}{\sum\limits_{i = 1}^{N}\; \left( {Ms}_{a} \right)_{i}}}$

In an embodiment, the rotation of the rotating apparatus is modeled as the rotation that takes place over a single spin axis of the rotating apparatus and is constant but arbitrary. In an embodiment, b_(sa) is independent of the magnetic field direction.

In an embodiment, the control module estimates b_(sa) by modeling the measured plurality of magnetic field values with a minimalistic three-parameter model which ensures that the norm is constant throughout a time period of interest. Initially, a basis for the measured plurality of magnetic field values where one of the axes is the spin axis s_(a) is generated. For, given parameters α_(sa) and β_(sa), from the solution of the optimization problem, the basis for the measured plurality of magnetic field values is defined by matrix:

${V = \begin{bmatrix} {{- \sin}\mspace{14mu} \alpha_{sa}\mspace{14mu} \cos \mspace{14mu} \beta_{sa}} & {{- \sin}\mspace{14mu} \alpha_{sa}\mspace{14mu} \sin \mspace{14mu} \beta_{sa}} & {\cos \mspace{14mu} \alpha_{sa}} \\ {\mspace{11mu} {\cos \mspace{14mu} \alpha_{sa}\mspace{14mu} \cos \mspace{14mu} \beta_{sa}}} & {\mspace{11mu} {\cos \mspace{14mu} \alpha_{sa}\mspace{14mu} \sin \mspace{14mu} \beta_{sa}}} & {\sin \mspace{14mu} \alpha_{sa}} \\ { {{- \sin}\mspace{14mu} \beta_{sa}}} & {\mspace{101mu} {\cos \mspace{14mu} \beta_{sa}}} & 0 \end{bmatrix}},$

where the spin axis is in a second row of the matrix, the basis vector of a third row is generated so that it is orthogonal to the spin axis, and the basis vector of a first row so that it is cross product of the second and third row. When transformed into such basis the measured plurality of magnetic field values are modeled with a three degrees of freedom model of the form:

${{{Vm}(t)} \approx {f\left( {b_{sa},\omega,\theta_{0}} \right)}} = \begin{bmatrix} {\sqrt{1 - b_{sa}^{2}}\mspace{14mu} {\sin \left( {{\omega \; t} + \theta_{0}} \right)}} \\ b_{sa} \\ {\sqrt{1 - b_{sa}^{2}}\mspace{14mu} {\cos \left( {{\omega \; t} + \theta_{0}} \right)}} \end{bmatrix}$

where ω is the spin rate estimated above and θ₀ represents a phase shift, wherein the phase shift is estimated by:

$\theta_{0} \approx {\pi - {\frac{1}{N}{\sum\limits_{i = 1}^{N}\; {\left\lbrack {\left( {\pi - {{atan}\; 2\left( {{{Vm}\left( t_{i} \right)}_{x},{{Vm}\left( t_{i} \right)}_{z}} \right)} + {\omega \; t_{i}}} \right)\mspace{14mu} {mod}\mspace{14mu} \left( {2\pi} \right)} \right\rbrack.}}}}$

A signal model is used to bind the uncoupled estimates of parameters b_(sa), ω, and θ₀ together by minimizing:

${\sum\limits_{i = 1}^{N}\; {{\frac{m\left( t_{i} \right)}{{{m\left( t_{i} \right)}}_{2}} - {V^{T}{f\left( {b_{sa},\omega,\theta_{0},t_{i}} \right)}}}}_{2}^{2}},$

or a similar cost function causing minimalistic three-parameter model f(b_(sa), ω, θ₀) to be as close to the observed data (e.g. magnetic field values) m(t) as possible. Once the cost function is selected, its value is minimized from the initial guess. Further, if the spin axis is horizontal, an alternate approach is the solution of a constrained minimization problem, which causes the minimization problem to yield a solution by:

|b _(sa)|<cos(magEle).

In an embodiment, the estimate of b_(sa) may depend on the magnetic field parameters, and the magnetic poles may include an additional tendency to retrieve all nearby solutions.

In an embodiment, the control module obtains a shot direction by representing the observed magnetic field in a horizontally level, headed towards a basket frame as:

$b = \begin{bmatrix} {\pm \sqrt{1 - \left( {b_{sa} - {{\sin (\alpha)}\mspace{14mu} {\sin ({magEle})}}} \right)^{2} - {\sin^{2}({magEle})}}} \\ {b_{sa} - {{\sin (\alpha)}\mspace{14mu} {\sin ({magEle})}}} \\ {\sin ({magEle})} \end{bmatrix}$

whenever 1−(b_(sa)−sin(α) sin(magEle))²−sin² (magEle)>0, where α is the angle between the spin axis and horizontal ground plane. The control module detects that the horizontal component of the spin axis is typically orthogonal to shot direction

$\left( {{- \frac{\pi}{2}} \leq s_{d} \leq \frac{\pi}{2}} \right).$

This, in the game of basketball example, leads to two solution candidates

$s_{d} = \left\{ {\begin{matrix} {\left\lbrack {\left( {\frac{\pi}{2} + {magAz} + {{atan}\; 2\left( {{+ b_{x}},b_{y}} \right)}} \right)\mspace{14mu} {mod}\mspace{14mu} \left( {2\pi} \right)} \right\rbrack - \pi} \\ {\left\lbrack {\left( {\frac{\pi}{2} + {magAz} + {{atan}\; 2\left( {{- b_{x}},b_{y}} \right)}} \right)\mspace{14mu} {mod}\mspace{14mu} \left( {2\pi} \right)} \right\rbrack - \pi} \end{matrix}.} \right.$

In an embodiment, the control module resolves the spin axis by employing a model of a form

${\frac{m\left( t_{i} \right)}{{{m\left( t_{i} \right)}}_{2}} \approx {R\mspace{14mu} {{{C\left( {{- \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix}},{\omega \; t}} \right)}\begin{bmatrix} {\cos \mspace{14mu} s_{d}} & {\sin \mspace{14mu} s_{d}} & 0 \\ {{- \sin}\mspace{14mu} s_{d}} & {\cos \mspace{14mu} s_{d}} & 0 \\ 0 & 0 & 1 \end{bmatrix}}\begin{bmatrix} {{\cos ({magEle})}\mspace{14mu} {\cos ({magAz})}} \\ {{\cos ({magEle})}\mspace{14mu} {\sin ({magAz})}} \\ {- {\sin ({magEle})}} \end{bmatrix}}}},$

where R is a rotation matrix, C(•,•) represents the Rodrigues' rotation formula as above, ω is the spin rate, and θ is the shot direction.

In an embodiment, the control module selects a branch using a first branch selection method. In an embodiment, the control module uses a secondary approach to resolve an orientation of the rotating apparatus when the rotating apparatus is released. In an embodiment, the orientation converts accelerations measured during the release of the rotating apparatus to a co-ordinate system related to for example a basketball court.

In an embodiment, the control module selects the branch using a user device that is communicating with the rotating apparatus through the network. In an embodiment, the user device, without limitation, may be selected from a mobile phone, a Personal Digital Assistant (PDA), a tablet, a desktop computer, or a laptop.

In an embodiment, the control module processes Received Signal Strength Indicator (RSSI) information to estimate a distance between a player and the user device. In an embodiment, the control module selects the branch if a location of the user device is known and a shot distance is estimated.

The control module automatically selects the branch by collecting a number of indicators and employs machine learning techniques. In one example embodiment, a neural network (NN) based classification network that indicates an index of the correct branch or a NN-based function fitting network directly estimates the shot direction. The control module automatizes a process of weighting different estimated shot directions to yield a combined solution, and a possibility to reject inconsistent shot direction estimates and automatically limits the solution into correct interval for maximum robustness.

According to an embodiment, determining the direction of the spin axis further comprises determining an angle between the spin axis of the projectile or ball and a horizontal ground plane. If there is an angle for between the horizontal ground plane and the spin axis this might lead to errors when determining the direction of the spin axis as the basic mathematical model is based on assumption of zero angle. The determined angle can be used to refine the determined direction of the spin axis.

According to yet another embodiment a horizontal displacement of the rotating apparatus is estimated. The horizontal displacement can be estimated using at least one of a flight time, a release speed, an initial height, and a height of the rotating apparatus in respect to ground. As an example if a flight time of the ball is 2 second and the speed (release speed can be assumed to be speed if friction is not taken in account) is 3.5 meters per second the horizontal displacement is 7 meters. Further a location of the rotating apparatus relative to a specified target can be determined by combining the direction of the spin axis of the rotating apparatus with the horizontal displacement. An example of a specified target is a basket of a basketball court (having long side in East-West direction). If also as an example the direction of the spin axis has been determined to be North we can determine that the shot was taken 7 meters from the basket in the direction of the long side (i.e. outside of 3 point line) i.e. where the location of the basket ball was when the shot was taken. I.e assuming that the long side of the court is in the East-West-direction, a spin axis pointing North indicates that the shot was taken in the direction of the long side. This is due to the −90 degree difference between spin axis and shot direction in given example. This location information is useful when analyzing the game. Furthermore the location can be derived using the method/apparatus without having external beacon or camera etc systems by this method. In an additional example the direction of the spin axis is determined to be towards East in game of football. The football field is in East-West direction. The ball hits a specific target (and for example detected with an optional accelerometer) of goal. If the horizontal displacement was 30 meters a location where the shot was made can be determined. The present method thus automatically determines a relative location of the rotating apparatus with respect to a specified target.

In the game of football in practical terms the spin axis of a straight shot-generally referred to as a pass or kick in the game of American style football—is rarely horizontal, but closer to the vertical direction, or a combination of horizontal and vertical displacement. In such cases, an angle between the spin axis and the horizontal ground plane can be used to enhance the determination of the location. For a pass/shot rolling and/or bouncing on the ground, the spin axis is closet to a horizontal one.

According to yet another embodiment, the global direction of the magnetic field is determined by ejecting the rotating apparatus for at least one time in a trajectory in a known horizontal direction. As an example we know that the rotating apparatus is ejected (thrown in an example of a ball) towards North. The known direction of North is provided to the control module. Alternatively, the known direction can be provided to smart phone receiving information from the control module of the rotating apparatus. Furthermore using at least one of local environment related geographical information can be used.

As an example if we know the direction of the long side of the basketball court it can be used as information to determine the global direction. Further the global direction can be determined by using a second sensor such as a sensor of a smart phone.

According to yet another embodiment, the method comprises using an accelerometer of the rotating apparatus for detecting if the rotating apparatus is ejected (thrown) on a ballistic trajectory. If the rotating apparatus is detected to be on the ballistic trajectory the XYZ-magnetic field sensor is activated. The present method thus optionally employs an accelerometer that is attached or otherwise secured to the inside of the rotating apparatus.

The accelerometer can be used to detect an acceleration of the rotating apparatus when the rotating apparatus is used. As an example the accelerometer can detect when the rotating apparatus is on a trajectory. For example, when the rotating apparatus is a ball, when the ball is thrown, the ball will follow a path under the action of the forces from the throwing motion. This throwing motion could also include passing or shooting, for example.

According to an embodiment the accelerometer activates the XYZ-magnetic field sensor if the rotating apparatus is detected to be in the ballistic trajectory, thereby reducing power consumption of the rotating apparatus. As the rotating apparatus is in the ballistic trajectory it is “free fall” state from the accelerator point of view i.e. the accelerometer reading is effectively zero. (or the reading can be used to deduct that the rotating apparatus is in a “free fall state”. As a note the accelerometer reading can comprise reading a value arising from or being generated by the rotation as well. This reduces power consumption as the direction of the spin axis is mainly needed when the rotating projectile is thrown in a trajectory such as a ballistic trajectory. This way the spin axis direction can be used for measuring where to projectile (such as a basketball) is being thrown. Alternatively the accelerometer can detect a movement of the projectile such as a hockey puck and activate the XYZ magnetic field sensor when the movement of the hockey puck is detected.

The optional accelerometer and the XYZ-magnetic field sensor communicate the measured data such as acceleration data and the plurality of magnetic field values of the rotating apparatus to the control module.

According to yet another embodiment, the direction of the spin axis is determined during a time interval when the rotating apparatus is on the ballistic trajectory. This way power consumption of the electronic components of the rotating apparatus can be reduced as the spin axis direction is determined only when the ball is determined to be in a trajectory. The magnetic field sensor can be kept off during other times such as during storage, non-use, or when holding the rotating apparatus in hand.

In an alternative embodiment a direction of a spin axis of a rotating apparatus comprising a XYZ-magnetic field sensor and a gyroscope is determined. First a global direction of a magnetic field is determined. Then a rotation for the rotating apparatus about the spin axis is provided, wherein the spin axis is defined along a line including points in a three-dimensional space which remain fixed during the rotation of the rotating apparatus. At least one magnetic field value with the XYZ-magnetic field sensor is measured when the rotating apparatus is rotating about the spin axis. The gyroscope is used to measure at least one angular speed value and orientation value. A direction of the spin axis is determined using measured at least one magnetic field value, the at least one angular speed value, the orientation value and the determined global direction of the magnetic field.

Gyroscope values can be used to determine spin axis. In this embodiment the angle between the gyroscope and magnetic field sensor is known. Thus, the magnetic field measurement provides information of the direction of the spin axis in respect to the local magnetic field can be determined. This is compared with the global direction to determine the direction of the spin axis.

The direction of the spin axis can be used as discussed earlier to determine for example the location of the rotating apparatus. Furthermore, if the rotating apparatus comprises an accelerometer the accelerometer readings can be used to switch the gyroscope on during the time the rotating apparatus is in a ballistic trajectory to save power.

In an example embodiment, when the rotating apparatus is a football, the plurality of magnetic field values are optionally measured using the XYZ-magnetic field sensor of the football when the football is rolling on the ground. The football is configured with the XYZ-magnetic sensor and optionally the XYZ-magnetic field sensor is configured to switch on only when the football is in the ballistic trajectory (i.e. shot, passed or kicked) or rolling on the ground. By limiting the times when the XYZ-magnetic sensor is used, the power consumption of the electronic components in the football are reduced.

The aspects of the disclosed embodiments provides an apparatus comprising:

-   -   a body;     -   an XYZ-magnetic field sensor arranged inside of the body and         configured to measure at least one magnetic field value as a         function of time when the body is rotating around or about a         spin axis;     -   a control module arranged inside of the body and communicatively         connected to the XYZ-magnetic field sensor, wherein the control         module is configured to         -   receive the measured at least one magnetic field value;         -   compute a magnetic field component of the at least one             magnetic field value in a direction of a local body             co-ordinate of the spin axis of the body from the received             at least one measured magnetic field value; and

determine a direction of the spin axis of the body using the computed magnetic field component of the magnetic field and the determined global direction of the magnetic field.

The determined direction of the spin axis of the body can be used for analyzing for example trajectories of the rotating apparatus. This is needed for example many sports activities to provide meaningful statistics or provide feedback on performance of the athletics. In essence the direction of the spin axis can be used as indication of the direction to which the rotating apparatus is going at a given moment of time. The magnetic field sensor (and other components) are arranged inside of the body of the apparatus. As an example the sensor can be arranged together with other components (such as controller and related battery+communication means and optional accelerometer) in a compact package. The compact package is attached to an inner surface of the body. In case of a basketball the inner surface of the body is same as the inner surface of the ball.

In an embodiment, the XYZ-magnetic field sensor is a device that detects and measures magnetic flux and/or a strength and a direction of the magnetic field at a particular location. The XYZ-magnetic field sensor is optionally a triaxial magnetometer. In an embodiment, the XYZ-magnetic field sensor is optionally attached to an inner surface of the rotating apparatus. In another embodiment, the XYZ-magnetic field sensor is optionally attached to an outer surface of the rotating apparatus. The rotating apparatus is optionally a basketball that is attached with the XYZ-magnetic field sensor and the control module. The rotating apparatus is optionally a football, soccer ball, baseball, puck or other sports object that includes the XYZ-magnetic field sensor and the control module.

In an embodiment, the rotating apparatus is communicatively connected with a server or a user device through a wired or a wireless network. The server optionally receives the measured plurality of magnetic field values from the rotating apparatus. The server may comprise a processor that determines a direction of the spin axis of the rotating apparatus. In an embodiment, the processor of the server optionally performs one or more steps of the control module. The server optionally comprises a personal computer, a tablet, a laptop or an electronic notebook. The components of the rotating apparatus are in communication via the communication network that is optionally a wired network or a wireless network. The user device optionally comprises a personal computer, a smartphone, a tablet, a laptop or an electronic notebook.

In an embodiment, the rotating apparatus optionally communicates the determined direction of the spin axis to the server. The server stores the determined direction of spin axis in a database. In an embodiment, the server is optionally a cloud service.

According to an embodiment, the rotating apparatus further includes a gyroscope arranged inside of the body of the rotating apparatus.

According to another embodiment, the rotating apparatus further comprises an accelerometer. The accelerometer is arranged inside of the rotating apparatus. As an example the accelerometer can be embedded in the compact package (as described earlier) which is mounted to inner surface of the body, the accelerometer being configured to provide accelerometer measurements to the control module and the control module is configured to:

-   -   detect from the provided accelerometer measurements if the         rotating apparatus is ejected on a ballistic trajectory (i.e.         passed, thrown or shot), and     -   provide an activation signal to the XYZ-magnetic field sensor if         the rotating apparatus is detected to be in the ballistic         trajectory to activate the XYZ-magnetic field sensor to perform         magnetic field measurement.

The present disclosure provides a system for determining location of a rotating apparatus, wherein the rotating apparatus configured to

-   -   determine a direction of a spin axis of the rotating apparatus;     -   estimate a horizontal displacement of the rotating apparatus         from a place of ejecting the rotating apparatus towards to a         specified target; and     -   provide the determined direction of the spin axis and the         estimated horizontal displacement to a portable computing         device,         wherein the portable computing device is configured to use the         provided direction and displacement values to determine a         location of the rotating apparatus in respect to the specified         target. As discussed earlier the location of the rotating         apparatus can be used to analyze for example a game of         basketball. The location in said example is location of a ball         in respect to target such as basket. As the location in respect         to the basket, direction and the basket location is known a user         can be provided with rendered view (on a user device) of shots         taken during a game or practice.

The advantages of the present system are thus identical to those disclosed above in connection with the present method and the embodiments listed above in connection with the present method apply mutatis mutandis to the system.

Embodiments of the present disclosure may determine a direction of the spin axis of the rotating apparatus more accurately. Embodiments of the present disclosure may determine a relative location of the rotating apparatus with respect to a specified target. Embodiments of the present disclosure beneficially reduce the power consumption of the rotating apparatus by switching on the XYZ-magnetic field sensor only when the rotating apparatus is moving along a trajectory. Embodiments of the present disclosure may determine a rotation speed of the rotating apparatus without gyroscope sensors which consume more power.

DETAILED DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic illustration of a rotating apparatus 102 in accordance with an embodiment of the present disclosure. The rotating apparatus 102 rotates about or at a spin axis 106. The rotating apparatus 102 (e.g. a basketball or a football) includes a XYZ magnetic field sensor 104 that is attached to a surface (e.g. an inner surface or an outer surface) of the rotating apparatus 102. In an embodiment, when the rotating apparatus 102 rotates about the spin axis 106, the XYZ magnetic field sensor 104 rotates around the spin axis 106 at the same rotational speed of the rotating apparatus 102. The functions of these parts has been described above.

FIG. 2 is a schematic illustration of a system in accordance with an embodiment of the present disclosure. The system includes a rotating apparatus 202 (such as a ball), a XYZ magnetic field sensor 204A, a control module 204B and communication module 204C. The control module 204B is communicatively connected to user device 206 via wireless communication. The user device can provide information via a network 208 to a server 210. The server 210 includes a database 212. The functions of these parts has been described above.

With reference to FIG. 1, FIG. 3 is a schematic illustration of a rotating apparatus 302 viewed from a direction B of the spin axis 106 (of FIG. 1) in accordance with an embodiment of the present disclosure. The rotating apparatus 302 rotates about a spin axis 306. The rotating apparatus 302 includes a XYZ magnetic field sensor 304 that is attached to an inside surface or structure of the rotating apparatus 302. The XYZ magnetic field sensor 304 rotates with an angular velocity (w) 308 around the spin axis 306. The functions of these parts has been described above.

FIG. 4 is a schematic illustration of a game field or court 400 in accordance with an embodiment of the present disclosure. The game field 400 (e.g. a basketball court) comprises a basket 408. In an embodiment, a first ball (e.g. a first rotating apparatus) 402A and a second ball (e.g. a second rotating apparatus) 402B are shot towards and/or into the basket 408 by users.

In an embodiment, by virtue of shooting the first ball 402A towards the basket 408, the first ball 402A rotates or spins along or about a first spin axis 406A. The first ball 402A includes a first XYZ magnetic field sensor 404A attached to an inner surface of the first ball 402A that rotates around the first spin axis 406A.

In an embodiment, when the second ball 402B is thrown or shot, the second ball 402B rotates along or about a second spin axis 406B. The second ball 402B includes a second XYZ magnetic field sensor 404B that is rotated around the second spin axis 406B.

A flying direction or trajectory of the first ball 402A and/or the second ball 402B is determined by determining a direction of the spin axis using their respective XYZ magnetic field sensor. In an embodiment, a flying time of the first ball 402A and a flying time of the second ball 402B is measured using an accelerometer and a timer.

In an example embodiment, magnetic field parameters of the game field 400 are computed based on parameters magEle (i.e. a horizontal direction of a local magnetic field with respect to an x-axis of the global magnetic field) and magAz (i.e. a vertical direction of the local magnetic field with respect to a local horizontal plane) which convert the obtained estimates of ball spin axis (b_(sa)) into more tangible direction estimates. In an embodiment, the b_(sa) values are computed to determine magnetic field parameters for a number of shots taken from known shot directions. In another embodiment, a shooter/user with an ability to consistently take shots with a horizontal spin axis may produce consistent b_(sa) values for each direction.

In yet another embodiment, an optimization process is implemented to determine a pair of magnetic field parameters. In an embodiment, the correct magnetic field parameters estimation is determined by verifying the computed value of magEle with a geomagnetic database.

In an embodiment, the first ball 402A and the second ball 402B are rolled on a floor towards the game field 408 from a number of different directions. In an embodiment, a set of shots including shots from different directions are used to determine the magnetic field parameters/values that the set of shots yields and shot direction estimates in the range of

${{- \frac{\pi}{2}} \leq s_{d} \leq \frac{\pi}{2}},$

where s_(d) is a direction of spin of the first ball 402A or the second ball 402B. This method does not require a direction of each shot, instead it requires the set of shots from different directions.

Further, a process may be implemented to use a maximum absolute value obtained for the b_(as) (with possible outliers removed) to determine magEle, such that |b_(sa)|_(max)=cos(magEle). Then, the magAz is used to set the values of spin direction (s_(d)) within the expected range.

FIG. 5 is a graphical illustration of accelerations of a shot measured by an accelerometer attached to a rotating apparatus in accordance with an embodiment of the present disclosure. The graphical illustration depicts an acceleration graph 504A, 504B, 504C based on acceleration data detected using an accelerometer during a release of the rotating apparatus. Graph 504A is an illustration of situation the rotating apparatus (ball) is being shot but before it is released from a hand. When the rotating apparatus is in the air or flying, the accelerometer reading 504C is 0 as the rotating apparatus is in free fall from the accelerometer point of view. As the rotating apparatus hits a target or ground a accelerometer reading 504B provides reading related to the impact. The accelerometer detects if the rotating apparatus is ejected on a ballistic trajectory and activates a XYZ-magnetic field sensor if the rotating apparatus is detected to be in the ballistic trajectory. The magnetic field values/data are sensed only when the rotating apparatus is in a ballistic trajectory and rotating about a spin axis, thereby reducing power consumption of the rotating apparatus.

The magnetic field values gathered by the XYZ-magnetic field sensor during the flying time is denoted by lines 502A, 502B and 502C. During the flight of the rotating apparatus, the XYZ-magnetic field sensor data on each of three axis appears as a sine-like curve with arbitrary offset, amplitude, frequency, and phase shift values for each axis of the XYZ-magnetic field sensors. These magnetic field values are coupled together if that magnetic field is homogeneous.

FIG. 6 is a graphical illustration of values of magnetic field components in accordance with an embodiment of the present disclosure. The graphical illustration depicts an overall behaviour of different values of b_(sa) as a contour plot demonstrating a shape of constant value of b_(sa) as a function of changing spin axis direction in the surrounding magnetic field. The graphical illustration further depicts horizontal rotations of the spin axis corresponding to a horizontal direction, and vertical rotations of spin axis corresponding to a horizontal direction, The graphical illustration shows a line 602 that represents the spin axis without any constraints.

For example, in basketball, a technically correct jump shot (neglecting layups, dunks, and such) is one where an angle between the horizontal ground plane and the spin axis is zero. This corresponds to line β_(sa)=0 which is shown as line 602 in the figure. With such a constraint for the spin axis, two results remain for the horizontal direction for the spin axis, for example, approximately ±40° degrees from magnetic south direction towards East and West, respectively. The graphical illustration shows a line 604 that indicates extremum values for magnetic field component along a horizontal spin axis, as indicated by cos(magEle) (i.e. a magnitude of the horizontal component of the magnetic field). The two possible results (both) reduce to the same direction, which is at least one of (i) North or (ii) South. Where the line 602 is located outside the “barriers”, the problem presented in this form has no real-valued and/or physical result for any horizontal spin axis. In practice, this line 602 may occur especially with inexperienced shooters, when magEle approaches ±90° and/or the direction of the spin axis is close to North or South direction. This also demonstrates a clear-cut dependency between accuracy and magEle for a horizontal spin axis: cos(magEle) that dictates a range of physically meaningful values for b_(sa), and the range decreases as |magEle| increases, therefore making the results increasingly more sensitive to the obtained value of b_(sa).

In an embodiment, a practical limit for reasonable accuracy for a horizontal spin axis is approximately ±80° which mainly depends on a quality of the XYZ magnetic field sensor and a shooter/player. In an embodiment, the accuracy of direction estimates degrades faster for inexperienced shooters as |magEle| increases.

FIGS. 7A-7B are flowcharts illustrating an exemplary process flow of a method for determining a direction of a spin axis of a rotating apparatus in accordance with the aspects of the disclosed embodiments. At a step 702, a global direction of a magnetic field is determined. At a step 704, a rotation of the rotating apparatus about the spin axis is provided. The spin axis comprises a line including points in a three-dimensional space which remain fixed during the rotation of the rotating apparatus. At a step 706, a plurality of magnetic field values are measured as a function of time with the XYZ-magnetic field sensor when the rotating apparatus is rotating around or about the spin axis. Typically spin axis goes via center of the rotating apparatus (for example in case of a ball).

At a step 708, a magnetic field component of the magnetic field in a direction of a local body co-ordinate of the spin axis of the rotating apparatus is computed from the measured plurality of magnetic field values. At a step 710, a direction of the spin axis is determined using the computed magnetic field component of the magnetic field and the determined global direction of the magnetic field.

Modifications to embodiments of the present disclosure described in the foregoing are possible without departing from the scope of the present disclosure as defined by the accompanying claims. Expressions such as “including”, “comprising”, “incorporating”, “have”, “is” used to describe and claim the present disclosure are intended to be construed in a non-exclusive manner, namely allowing for items, components or elements not explicitly described also to be present. Reference to the singular is also to be construed to relate to the plural. 

1. A method for determining a direction of a spin axis of a rotating apparatus, the rotating apparatus comprising a XYZ-magnetic field sensor, the method comprising: determining a global direction of a magnetic field; providing a rotation for the rotating apparatus about the spin axis, wherein the spin axis is defined along a line including points in a three-dimensional space which remain fixed during the rotation of the rotating apparatus; measuring a plurality of magnetic field values as a function of time with the XYZ-magnetic field sensor when the rotating apparatus is rotating about the spin axis; computing a magnetic field component of the magnetic field in a direction of a local body co-ordinate of the spin axis of the rotating apparatus from the measured plurality of magnetic field values; and determining a direction of the spin axis using the computed magnetic field component of the magnetic field and the determined global direction of the magnetic field.
 2. The method according to claim 1, the method further comprising: determining an angle between the spin axis and a horizontal ground plane; and using the determined angle to refine the determined direction of the spin axis.
 3. The method according to claim 1, wherein the determining of direction the spin axis further comprises: finding a direction that minimizes a variance of the measured plurality of magnetic field values; and resolving a sign ambiguity related to the found a direction that minimizes a variance of the measured plurality of magnetic field values by comparing two consecutively measured magnetic field values of the measured plurality of magnetic field values with each other and using the found direction with the resolved sign as the direction of the spin axis.
 4. The method according to claim 1, wherein the method further comprises estimating a horizontal displacement of the rotating apparatus using at least one of a flight time, a release speed, an initial height, and a height of the rotating apparatus in respect to ground; and determining a location of the rotating apparatus relative to a specified target by combining the direction of the spin axis of the rotating apparatus with the horizontal displacement.
 5. The method as claimed in claim 1, wherein the global direction of the magnetic field is determined by: ejecting the rotating apparatus at least one time along a trajectory in a known horizontal direction, using at least one of local environment related geographical information, or using a second sensor.
 6. The method as claimed in claim 1, wherein the method further comprises: using an accelerometer of the rotating apparatus to detect if the rotating apparatus is ejected on a ballistic trajectory, and activating the XYZ-magnetic field sensor if the rotating apparatus is detected to be in the ballistic trajectory.
 7. The method as claimed in claim 1, wherein the direction of the spin axis is determined during a time interval when the rotating apparatus is on the ballistic trajectory.
 8. A method for determining a direction of a spin axis of a rotating apparatus, the rotating apparatus comprising a XYZ-magnetic field sensor and a gyroscope, the method comprising: determining a global direction of a magnetic field; providing a rotation for the rotating apparatus about the spin axis, wherein the spin axis is defined along a line including points in a three-dimensional space which remain fixed during the rotation of the rotating apparatus; measuring at least one magnetic field value with the XYZ-magnetic field sensor when the rotating apparatus is rotating about the spin axis; measuring at least one angular speed value and orientation value with the gyroscope determining a direction of the spin axis using measured at least one magnetic field value, the at least one angular speed value, the orientation value and the determined global direction of the magnetic field.
 9. A rotating apparatus, comprising: a body; a XYZ-magnetic field sensor arranged inside of the body and configured to measure at least one magnetic field value as a function of time when the rotating apparatus is rotating about a spin axis; a control module arranged inside of the body and communicatively connected to the XYZ-magnetic field sensor, wherein the control module is configured to: receive the measured at least one magnetic field value; compute a magnetic field component of a magnetic field in a direction of a local body co-ordinate of the spin axis of the rotating apparatus from the received at least one measured magnetic field value; and determine a direction of the spin axis using the computed magnetic field component of the magnetic field and a determined global direction of the magnetic field.
 10. The rotating apparatus as claimed in claim 9, further comprising a gyroscope arranged inside of the body of the rotating apparatus.
 11. The rotating apparatus as claimed in claim 9, further comprising an accelerometer arranged inside of the rotating apparatus, wherein the accelerometer is configured to provide accelerometer measurements to the control module and the control module is configured to: detect from the provided measurements if the rotating apparatus is ejected on a ballistic trajectory, and provide an activation signal to the XYZ-magnetic field sensor if the rotating apparatus is detected to be in the ballistic trajectory to activate the XYZ-magnetic field sensor for a magnetic field measurement.
 12. A system for determining location of a rotating apparatus, wherein the rotating apparatus is configured to: determine a direction of a spin axis of the rotating apparatus; estimate a horizontal displacement of the rotating apparatus from a place of ejecting the rotating apparatus towards a specified target; and provide the determined direction of the spin axis and the estimated horizontal displacement to a portable computing device, wherein the portable computing device is configured to use the provided direction and displacement values to determine a location of the rotating apparatus in respect to the specified target. 